package edu.sctu.xialei.june.day20150610one.modle;

/**
 * Created by Administrator on 6/10/2015.
 */

//安检员
public class SafetyInspector {
    public String name;
    public String sex;

    public void inspection(Passenger passenger, String[] dangerousParcel, String[] dangerousWater) {

        if (passenger.parcel != null) {
            for (int i = 0; i < dangerousParcel.length; i++) {
                if (passenger.parcel.content.equals(dangerousParcel[i])) {
                    System.out.println("包裹中有危险品！！！乘客被扣留！");
                    System.exit(1);
                }
            }
        }
        if (passenger.water != null) {
            for (int i = 0; i < dangerousWater.length; i++) {
                if (passenger.water.content.equals(dangerousParcel[i])) {
                    System.out.println("有危险液体！！！乘客被扣留！");
                    System.exit(1);
                }
            }
            System.out.println("该乘客没有携带违禁品，通过！");
        }
    }
}
